/**
 * 子模块路由
 * djp
 */

var router = function($urlRouterProvider, $stateProvider){

 	$stateProvider

 	  .state('app.createnotice', {
        url: '/noticelist',
         views: {
            'main@' : {
                    controller : 'noticelist',
                    template: require('./views/noticelist.html'),
                }
            },
        resolve:{
            mylist : function(noticeservice){
                return noticeservice.mylist();
            },
            update : function(noticeservice){
                return noticeservice.update();
            }
        }
      })

      .state('app.noticecreate', {
        url: '/notice',
        views: {
            'main@' : {
                    controller : 'noticecreate',
                    template: require('./views/noticemodel.html'),
                }
            },
        resolve:{
            create : function(noticeservice){
                return noticeservice.create();
            },
            place_code : function(noticeservice){
                return noticeservice.place_code();
            }
        }
      })


      .state('app.noticeedit', {
        url: '/notice/:id',
         views: {
            'main@' : {
                    controller : 'noticeedit',
                    template: require('./views/noticemodel.html'),
                }
            },

        resolve:{
            myinfo : function(noticeservice){
                return noticeservice.myinfo();
            },
            update : function(noticeservice){
                return noticeservice.update();
            },
            place_code : function(noticeservice){
                return noticeservice.place_code();
            }
        }
      })

      // .state('app.messagetemplet', {
      //   url: '/messagetempletlist',
      //   controller : 'messagetempletlist',
      //   template: require('./notice/messagetempletlist.html'),
      //   resolve:{
        	
      //   }
      // })


};

module.exports = router;